{template 'common/header'}
{php echo $this -> set_tabbar($action);}
<div class="main">
    <div class="alert alert-info">奖励积分(必须为整数)  <font color="red">注意:设置为0的时候表示不启用</font></div>
    <form action="" method="post" onsubmit="return check();" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default">
            <div class="panel-heading">
                策略名称
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">每天签到奖励</label>
                    <div class="col-sm-9">
                        <div class="input-group input-medium">
                            <input type="text" name="day_score" id="day_score" value="{if empty($reply)}1{else}{$reply['day_score']}{/if}" class="form-control" >
                            <span class="input-group-addon">分</span>
                        </div>
                        <div class="helo-block">设置为0的时候即不开启签到功能</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">连续签到奖励</label>
                    <div class="col-sm-9">
                        <div class="input-group">
                            <span class="input-group-addon" style="border-right:0px;">连续</span>
                            <input type="text" class="form-control" name="runningdays" id="runningdays" value="{if empty($reply)}0{else}{$reply['runningdays']}{/if}">
                            <span class="input-group-addon" style="border-left:0px;border-right:0px;">天奖励</span>
                            <input type="text" name="dayx_score" id="dayx_score" value="{if empty($reply)}0{else}{$reply['dayx_score']}{/if}" class="form-control" >
                            <span class="input-group-addon" style="border-left:0px;">分</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">消费1元奖励</label>
                    <div class="col-sm-9">
                        <div class="input-group input-medium">
                            <input type="text" name="payx_score" id="payx_score" value="{if empty($reply)}0{else}{$reply['payx_score']}{/if}" class="form-control" >
                            <span class="input-group-addon">分</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">充值1元奖励</label>

                        <div class="col-sm-9">
                            <div class="input-group input-medium">
                                <input type="text" name="recharge_score" id="recharge_score" value="{if empty($reply)}0{else}{$reply['recharge_score']}{/if}" class="form-control" >
                                <span class="input-group-addon">分</span>
                            </div>
                        </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">积分规则说明</label>
                    <div class="col-sm-9">
                        <textarea class="form-control richtext-clone" name="score_info" cols="70" id="score_info" style="height: 100px;">{$reply['score_info']}</textarea>
                        <!--1、本卡采取记名消费方式-->
                        <!--2、持卡人可享受会员专属优惠-->
                        <!--3、本卡不能与其他优惠活动同时使用-->
                        <!--4、持卡人可用卡内余额进行消费-->
                    </div>

                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <button type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交">保存设置</button>
                <input type="hidden" name="token" value="{$_W['token']}" />
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function check() {
        if($.trim($('#day_score').val()) == '') {
            message('没有输入图片标题.', '', 'error');
            return false;
        }
        var day_score = $.trim($('#day_score').val());
        if(isNaN(day_score)){
            message('每天签到奖励必须为数字.', '', 'error');
            return false;
        }
        var dayx_score = $.trim($('#dayx_score').val());
        if(isNaN(dayx_score)){
            message('连续6天签到奖励必须为数字.', '', 'error');
            return false;
        }
        var payx_score = $.trim($('#payx_score').val());
        if(isNaN(payx_score)){
            message('消费1元奖励必须为数字.', '', 'error');
            return false;
        }

        day_score = parseInt(day_score);
        dayx_score = parseInt(dayx_score);
        payx_score = parseInt(payx_score);
        if(day_score < 0 || dayx_score < 0 || payx_score < 0){
            message('积分请不要输入负数.', '', 'error');
            return false;
        }
        if(day_score > 100000 || dayx_score > 100000 || payx_score > 100000){
            message('积分请不要输入大于10万.', '', 'error');
            return false;
        }
        return true;
    }
</script>
<script type="text/javascript">
    kindeditor($('.richtext-clone'));
</script>
{template 'common/footer'}
